Do not accept BABL_FISH_REFERENCE as a valid result when fishing for
authorØyvind Kolås <ok@src.gnome.org>
Sat, 10 Nov 2007 23:19:11 +0000 (23:19 +0000)
committerØyvind Kolås <ok@src.gnome.org>
Sat, 10 Nov 2007 23:19:11 +0000 (23:19 +0000)
existing fishes.
* babl/babl-fish.c: (fishing_result_examine), (babl_fish):

svn path=/trunk/; revision=245

ChangeLog
babl/babl-fish.c

index a3e5c16ce5c0719f2fff02bee15e8bd7634c7c05..7f55eb0903577000d8b8e7731083fcbde67da06d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-11-10  Øyvind Kolås  <pippin@gimp.org>
+
+       Do not accept BABL_FISH_REFERENCE as a valid result when fishing for
+       existing fishes.
+
+       * babl/babl-fish.c: (fishing_result_examine), (babl_fish):
+
 2007-11-10  Øyvind Kolås  <pippin@gimp.org>
 
        * docs/index-static.html.in: documented BABL_STATS environment
index 509815f7ccfec15faded925341092e5047129f31..f0a5ee7b5fe47b5817827dcc7b762d97192661c5 100644 (file)
@@ -73,6 +73,12 @@ fishing_result_examine (Babl *babl,
       (void *) data->destination == (void *) babl->fish.destination)
     {
       data->ret = babl;
+      /* we do not return BABL_FISH_REFERENCE's since those might exist
+       * even before a valid BABL_FISH_PATH has been constructed for a
+       * given conversion.
+       */
+      if (data->ret->class_type == BABL_FISH_REFERENCE)
+        return 0;
       return 1;     /* stop iterating */
     }
   return 0;  /* continue iterating */
@@ -137,14 +143,16 @@ babl_fish (void *source,
       return NULL;
     }
 
-  {
+  if(1){
     Babl *lucky;
     lucky = go_fishing (source_format, destination_format);
     if (lucky)
       return lucky;
   }
 
-  if (0)
+  if (0) /* do not accept shortcut conversions, since there might be
+            a faster path
+          */
     {
       Babl *shortcut_conversion;